<?php
// Load core.
include_once 'engine/core.php';

// Get the requested URL.
$g_sRequest = $g_aConfig['default_request'];
if (isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING'])
{
	$g_sRequest = $_SERVER['QUERY_STRING'];
}

// Pass request string throught plugins filters.
$g_sRequest = $oPlugins->ExecuteFilters('Request', $g_sRequest);

// Register system event.
$oTimer->RegisterEvent(sprintf($g_aLang['core']['plugins']['loading_for_request'], $g_sRequest));

// Get the plugin page.
$sPluginPage = $oPlugins->LoadPage($g_sRequest);

if ($sPluginPage == "__EXIT")
{
	die;
}

$oTimer->RegisterEvent($g_aLang['core']['plugins']['ppage_loaded']);

// Execute plugins actions before show the plugin page.
$oPlugins->ExecuteEvent('ShowPluginPage:before');

// Pass plugin page throught filters and display it.
echo $oPlugins->ExecuteFilters('PluginPage', $sPluginPage);

// Execute plugins actions after show the plugin page.
$oPlugins->ExecuteEvent('ShowPluginPage:after');
